package com.zhao.dota.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhao.dota.model.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<User> {

    @Select("select u.* from user u " +
            "  left join user_role ur " +
            "    on u.id = ur.user_id " +
            "  left join role r " +
            "    on ur.role_id = r.id " +
            " where r.code = #{roleCode} ")
    List<User> findByRoleCode(String roleCode);

}
